namespace AdminSG3L.Applicaticn.ServicesInterface;

using AdminSG3L.Domain.Entities;
using AdminSG3L.Applicaticn.Commands;
using AdminSG3L.Applicaticn.Dtos;

/// <summary>
/// 菜单服务接口，定义菜单相关的应用层操作
/// </summary>
public interface IMenuService
{
    /// <summary>
    /// 创建新菜单
    /// </summary>
    Task<ApiResponse<MenuDto>> CreateAsync(CreateMenuDto dto);

    /// <summary>
    /// 批量添加菜单
    /// </summary>
    Task<ApiResponse<IEnumerable<MenuDto>>> BatchCreateAsync(IEnumerable<CreateMenuDto> dtos);

    /// <summary>
    /// 更新菜单信息
    /// </summary>
    Task<ApiResponse<bool>> UpdateAsync(UpdateMenuDto dto);

    /// <summary>
    /// 删除菜单
    /// </summary>
    Task<ApiResponse<bool>> DeleteAsync(Guid id);

    /// <summary>
    /// 批量删除菜单
    /// </summary>
    Task<ApiResponse<int>> BatchDeleteAsync(IEnumerable<Guid> ids);

    /// <summary>
    /// 查询所有菜单
    /// </summary>
    Task<ApiResponse<IEnumerable<MenuDto>>> GetAllDtoAsync();

    /// <summary>
    /// 分页查询菜单
    /// </summary>
    Task<ApiResponse<(IEnumerable<MenuDto> Menus, int TotalCount)>> GetPagedDtoAsync(int pageIndex, int pageSize);

    /// <summary>
    /// 获取菜单总数
    /// </summary>
    Task<ApiResponse<int>> GetCountAsync();

    /// <summary>
    /// 条件查询单个菜单
    /// </summary>
    Task<ApiResponse<MenuDto?>> FindOneAsync(Func<MenuDto, bool> predicate);

    /// <summary>
    /// 条件查询多个菜单
    /// </summary>
    Task<ApiResponse<IEnumerable<MenuDto>>> FindManyAsync(Func<MenuDto, bool> predicate);

    /// <summary>
    /// 给菜单分配角色
    /// </summary>
    Task<ApiResponse<bool>> AssignRoleAsync(Guid menuId, Guid roleId);

    /// <summary>
    /// 移除菜单角色
    /// </summary>
    Task<ApiResponse<bool>> RemoveRoleAsync(Guid menuId, Guid roleId);

    /// <summary>
    /// 设置菜单父级
    /// </summary>
    Task<ApiResponse<bool>> SetParentAsync(Guid menuId, Guid? parentId);

    /// <summary>
    /// 修改菜单启用状态
    /// </summary>
    Task<ApiResponse<bool>> SetEnabledAsync(Guid menuId, bool enabled);

    Task<ApiResponse<MenuDto?>> GetDtoByIdAsync(Guid id);
} 